package cn.dengta.webapp.user.vo;

import java.util.Date;
import java.util.Map;

import cn.dengta.common.util.Formats;
import cn.dengta.webapp.base.vo.AbstractVO;
import cn.dengta.webapp.user.entity.UserDestroyLog;
import cn.dengta.webapp.user.model.UserStatus;
import lombok.Getter;
import lombok.Setter;
import me.codeplayer.util.X;

@Getter
@Setter
public class UserDestroyLogVO extends AbstractVO<UserDestroyLog> {

	/** 用户ID */
	public Map<String, Object> user;
	/** 操作用户Id */
	private transient Long addUserId;
	/** IP地址 */
	private String addIp;
	/** 备注信息 */
	private String remark;
	/** 推广员信息 */
	private Map<String, Object> agent;
	/** 注销时间 */
	private transient Date destroyTime;
	/** 状态 */
	private Integer status;

	public static UserDestroyLogVO from(UserDestroyLog source) {
		return copy(source, UserDestroyLogVO::new);
	}

	public String getDestroyTime_() {
		return Formats.formatDatetime(destroyTime);
	}

	public String getStatus_() {
		return X.map(UserDestroyLog.DestroyStatus.of(status), UserDestroyLog.DestroyStatus::getLabel);
	}

	public String getAddTime_() {
		return super.getAddTime_();
	}

}
